package com.findmeastore.util;

public class CollectionUtil {
	
	 /**
	   * Checks for an object(not null) in an object array and returns true if found in the array, false otherwise
	  */
	  public static boolean contains(Object needle, Object[] haystack){
	    boolean inArray = false;
	    if(haystack != null){
	      for(Object eachInHaystack : haystack){
	        if(eachInHaystack != null && eachInHaystack.equals(needle)){
	          inArray = true;
	          break;
	        }
	      }
	    }
	    return inArray;
	  }

}
